<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class Order extends Model
{
    // 订单表
    protected $table = 'user_order';
    protected $primaryKey = 'id';
    protected $dateFormat = 'U';
    protected $casts = [
        'created_at' => 'datetime:Y-m-d H:i',
        'updated_at' => 'datetime:Y-m-d H:i'
    ];

    public function product(){
        return $this->belongsTo('App\Model\Product','product_id');
    }

    public function user(){
        return $this->belongsTo('App\Model\Users','user_id');
    }
}
